package com.fancy.recommendation.service;

import com.fancy.recommendation.dto.request.RecommendationRequestDTO;
import com.fancy.recommendation.dto.response.RecommendationResponseVO;
import com.fancy.recommendation.entity.Recommendation;

import java.util.List;

/**
 * 推荐算法服务接口
 *
 * @author fancy
 */
public interface RecommendationService {

    /**
     * 获取个性化推荐
     */
    RecommendationResponseVO.RecommendationListVO getPersonalRecommendations(RecommendationRequestDTO request);

    /**
     * 协同过滤推荐
     */
    List<Recommendation> collaborativeFiltering(Long userId, String targetType, Integer size);

    /**
     * 基于内容的推荐
     */
    List<Recommendation> contentBasedRecommend(Long userId, String targetType, Integer size);

    /**
     * 热门推荐
     */
    List<Recommendation> trendingRecommend(String targetType, Integer size);

    /**
     * 混合推荐算法
     */
    List<Recommendation> hybridRecommend(Long userId, String targetType, Integer size);

    /**
     * 获取相似推荐
     */
    List<Recommendation> getSimilarRecommendations(String targetType, Long targetId, Integer limit);

    /**
     * 刷新用户推荐
     */
    void refreshUserRecommendations(Long userId);

    /**
     * 生成推荐结果
     */
    void generateRecommendations(Long userId, String recType, String algorithm);

    /**
     * 获取缓存的推荐结果
     */
    List<Recommendation> getCachedRecommendations(Long userId, String recType, Integer limit);

    /**
     * 更新推荐反馈
     */
    void updateRecommendationFeedback(Long recommendationId, String feedback);
}
